// Copyright 2010 Google Inc. All Rights Reserved.

package SAGA_1.main;

import java.io.IOException;
import java.util.*;

import ga.GA;
import rt.RT;
import util.GAConfig;
import util.GAOperationsConfig;
/**
 * The entry class for test generation.
 * 
 *
 */
public class OfflineMain {

 
  //the file
   public static void main(String[] args) throws IOException, ClassNotFoundException {
    
        //only for experiment
        System.out.println("In experiment environment ....");
        List<String> class_txt_file=getExperiment_ListClasses();
        List<Integer> class_maximum_branch=getclass_maximum_branch();

        String[] cut=new String[2];

	    for(int algo=1;algo<=4;algo+=1){
      	
	           for(int i=0;i<class_txt_file.size();i++){

	        	cut[0]=class_txt_file.get(i);
	        	cut[1]=class_maximum_branch.get(i).toString();
	        	switch (algo) {
	        	case 1:
		        	GAOperationsConfig.setGAOperationsToNull();
	        		GAConfig.UseReadWrietRelation=true;
	        		GAConfig.IsSearchStaganated=false;
	//	        	GAOperationsConfig.getAlgorithms();

	        		GA.main(cut);
	        		break;
	        	case 2:
		        	GAOperationsConfig.setGAOperationsToNull();
		        	GAConfig.UseReadWrietRelation=false;
		        	GAConfig.IsSearchStaganated=false;
	        		GA.main(cut);
	        		break;
	        	case -3:
		        	GAOperationsConfig.setGAOperationsToNull();
		        	GAConfig.UseReadWrietRelation=false;
		        	GAConfig.IsSearchStaganated=true;
	        		GA.main(cut);
	        		break;
	        	case 4:
	        		RT.main(cut); 
	        		break;
	        	}
	        }
        }
        System.exit(0);
  }
  
  
   public static List<String> getExperiment_ListClasses(){
		  List<String> ListClasses=new LinkedList<String>();
//		  ListClasses.add("/nfs/guille/u2/a/aburas/WorkSpace/Test_Subjects/commons/CUT.txt");		  
//		  ListClasses.add("/nfs/guille/u2/a/aburas/WorkSpace/Test_Subjects/Conzilla/CUT.txt");
		  ListClasses.add("/nfs/guille/u2/a/aburas/workspace/Experimentalsubjects/NanoXML/CUT.txt");
//		  ListClasses.add("/nfs/guille/u2/a/aburas/workspace/Experimentalsubjects/JodaTime/CUT.txt");
//		  ListClasses.add("/nfs/guille/u2/a/aburas/workspace/Experimentalsubjects/common-lang3/CUT.txt");
		  return ListClasses;
	  }
	  public static List<Integer> getclass_maximum_branch(){
		  List<Integer> ListClasses=new LinkedList<Integer>();
	      ListClasses.add(54);//(560);//(806);//("c:/MAMDA/jdom.git/CUT.txt");
		  ListClasses.add(58);//"C:/MAMDA/MAMDA/roops/CUT.txt");	  
		  ListClasses.add(145);//("C:/MAMDA/JodaTime/CUT.txt");
		  ListClasses.add(72);//"c:/MAMDA/MAMDA/TestClasses/StringTkoenizer.txt");
		  ListClasses.add(140);//"c:/MAMDA/MAMDA/TestClasses/Fraction.txt");
		  ListClasses.add(136);//"C:/MAMDA/NanoXML/CUT.txt");

	      ListClasses.add(62);//(560);//(806);//("c:/MAMDA/BinomialHeap/CUT.txt");
	      ListClasses.add(148);//(560);//(806);//("c:/MAMDA/AvlTree/CUT.txt");
	      ListClasses.add(158);//(560);//(806);//("c:/MAMDA/TreeMap/CUT.txt");

		  return ListClasses;
	  }
 
}